home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CU Amiga Super CD-ROM 17
/
CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso
/
CUCD
/
Programming
/
DiceSource
/
test
/
lib
/
why.c
< prev
Wrap
C/C++ Source or Header
|
1992-11-23
|
647b
|
35 lines
#include <exec/types.h>
#include <libraries/dos.h>
#include <libraries/dosextens.h>
#include <stdio.h>
typedef struct CommandLineInterface CLI;
main(ac, av)
char *av[];
{
struct Process *proc = FindTask(NULL);
if (ac > 1) {
FILE *fi = fopen("ram:z", "w");
long fh;
long fh2;
fprintf(fi, "ram:why\n");
fclose(fi);
if (fh = Open("ram:z", 1005)) {
fclose(stderr);
fh2 = Open("*", 1006);
puts("ok");
printf("execute: %d\n", Execute(av[1], fh, fh2));
Close(fh);
Close(fh2);
}
}
CLI *cli = (CLI *)((long)proc->pr_CLI << 2);
if (cli)
printf("cli return code: %d\n", cli->cli_ReturnCode);
}